POV-Ray : Newsgroups : povray.off-topic : Design patterns : Re: Design patterns Server Time
7 Sep 2024 07:20:13 EDT (-0400)
  Re: Design patterns  
From: Orchid XP v8
Date: 5 Jul 2008 05:03:51
Message: <486f38f7$1@news.povray.org>
Warp wrote:
>   There really *are* design patterns which might sound obvious to you
> and me, but are not all that obvious to many programmers who are starting
> to dig into OOP.
> 
>   One example I like (and which name I rather ironically cannot remember
> now) is the design pattern which you can use to create primitives and
> unions of primitives, so that the union itself is a primitive (thus
> allowing a union to contain other unions, containing other unions,
> thus forming a whole hierarchy of primitives).

It's called Container or Composite or something like that. (Also related 
to the Decorator pattern - although that does the same thing for a 
different reason.)

>   This is a simple idea and might be obvious to some, but it certainly
> might not obvious to the new OO programmer.

Many good ideas seem obvious *after* somebody told you. ;-)

For example, (A*B)^2 - 4*(A+B) = (A-B)^2. Obvious once you know, but 
DAMN... I've have never thought of it!

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.